

from airflow.utils.session import create_session
from airflow.models.dag import DagModel
import time

with create_session() as session:
    query = session.query(DagModel).filter(DagModel.dag_id == 'dag-10').with_for_update(skip_locked=True)
    print(len(query.all()))

    dialect = session.bind.dialect

    if dialect.name != "mysql" or dialect.supports_for_update_of:
        print(True)
    else:
        print(False)
